[Perf] Reduce DFlash2 long-context verification decay - #587
Merged
yangzhuxinyzx merged 14 commits intoSep 10, 2026
Merged
Conversation
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain raw byte differences while checking bijective slots and the source-defined convolution history window. Keep live state, verifier output storage and full-vocabulary probabilities under exact comparison. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Complete the three-startup paired curve and fixed-prefix comparisons, add explicit 17/18/20/22 ms context targets, and extend operator boundary checks to 256K. Preserve the slower bit-exact QK/PV prototype as a rejected, opt-in benchmark candidate. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain raw storage mismatches while requiring a bijection across every observed state access. Live value changes and aliased mappings still fail. Validated with 22 focused tests; one GPU-only case skipped. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Retain independent native builders, resource diagnostics and failed candidates. PV reuse remains gated after a free-generation mismatch. Correct the private pipeline softmax extraction before repeating its operator checks. No serving route is enabled by these experiments. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
The first paired startup reduces the 261888-input complete round from 38.563 to 36.428 ms with identical output and acceptance. Add a reviewable opt-in worker probe and native harness, retain all sanitizer evidence, and record rejected warp pipelines and the lossless KV mirror. Repeated startup admission remains pending. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
…hases Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
Record three paired startups, exact scalar page-map resource controls, small-Q native reference coverage, and rejected QK schedules. Keep all experiments disabled by default. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This was referenced Sep 10, 2026
yangzhuxinyzx
changed the base branch from
codex/v100-dflash2-context-cost-20260909-131223
to
main
September 10, 2026 08:59
yangzhuxinyzx
marked this pull request as ready for review
September 10, 2026 08:59
yangzhuxinyzx
added a commit
that referenced
this pull request
Sep 10, 2026
User-authorized main integration after prerequisites #586 and #587. Preserve explicit opt-in activation and unmet 7-ms attention / 22-ms round targets. Combined-tree tests:26 passed,1 skipped; scoped pre-commit passed. Assisted-by: Codex Signed-off-by: yangzhuxinyzx <153831768+yangzhuxinyzx@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Reduce complete DFlash2 verification-round latency and long-context growth on rear GPUs 4–7, TP4/B1/q8. Targets are 32K ≤17 ms, 64K ≤18 ms, 128K <20 ms and 256K <22 ms, with no quality or acceptance regression. Targets remain unmet; all experimental defaults remain disabled. Service capacity remains 262144; the boundary-window test uses 261888 input plus 256 output tokens.
This continues #587, stacked on #586, without opening a duplicate PR. Integration freeze:
80545c010bbf6f5ed06458d992c189d75d0eff8f. Serving source remains239d71c7100b3bce5526268be2cafb4cff8ba8f2; review head is1994baff8f188a2c915e883395ae96e682db0577. Source/library hashes, dispatch and retained failures are in the worklog.Implementation
Test Plan and Result
Visible-tile q8 versus its PV-reuse parent completes three paired independent starts, 180 requests and 90 exact pairs, including tokens, finish reason and acceptance. One cold and five measured requests per context/arm; no profiler or tensor dump. Original scalar q1 is retained in both arms:
These are medians of startup medians. The third 32K pair is 0.005 ms slower and remains included. Request-average quantiles, cold TTFT/prefill and incremental costs are separately reported in the worklog. Native output/full-workspace checks and the visible operator's own three sanitizers pass.
Compact scalar lookup plus a 4096-byte shared reservation passes 45 operator byte checks and all three sanitizers. Its first service A/B holds visible-tile q8 fixed, hits 384 scalar calls per rank and preserves all 12 request pairs: 261888 round 37.160→35.602 ms, pure decode 137.245→143.250 tokens/s, accepted drafts 4.02/round and emitted tokens 5.12/round unchanged. This is one startup; it cannot be ranked against a different earlier trajectory. A separate actual-input diagnostic retains 96 exact comparisons but samples only eight unique K/V pointer pairs per rank; its incorrect sixteen-pair final assertion and incomplete full-layer coverage remain recorded.
New full-round traces confirm q6 and q1 eager work at the capacity boundary. Every q2–q7 shape now passes 60 output/full-FP32-workspace checks against the actual frozen production library. The q6 16-layer working set improves 12.176→7.796 ms at 128K and 23.717→15.066 ms at 261888. This is an operator screen; small-Q sanitizers and service-route admission are still required.
The original selected natural-EOS campaign has 26/30 complete exact pairs, including all 12 structured/tool cases; four seed-2 code cases remain. These are paired non-regression observations, not new benchmark scores. Unchanged-control startup drift remains unresolved and is never an allowed numerical tolerance.
Scoped pre-commit passes. GPU commands use
benchmark_sm70_grouped_attention_long,benchmark_sm70_scalar_attention, andbenchmark_sm70_grouped_attention_precision; source/library identities and raw reports are retained. NCU counters remain unavailable. Static resources, CTA clocks and data-derived bank proxies are not achieved hardware utilization.Remaining gates
Finish tail-route attribution and actual-input coverage, then paired service/repeated-start admission for the best tail combination. Continue reducing the major costs exposed by the complete trace. N64 variants, register-held softmax state, M8/N32 QK, operand rotation and the FP64-sum candidate fail their gates and remain closed. The user explicitly approved merging the current implementation on 2026-09-10. Default enablement remains subject to the outstanding quality and performance gates.
AI assistance: implementation, audit tooling and this report were assisted by Codex. The current main merge is explicitly user-authorized; numerical and performance claims retain the limits above.
Main integration
The user explicitly requested merging the current DFlash2 optimization work to main on 2026-09-10. Merge order: #586 → #587 → #589. The combined tree against main
0a0d4d6754f553ab00307eac807e9b5963b58b37merges cleanly and passesCUDA_VISIBLE_DEVICES='' .venv/bin/python -m pytest -q tests/v1/worker/test_sm70_long_attention_graphs.py tests/kernels/core/test_sm70_dflash2_state_audit.py(26 passed, 1 skipped) and scoped pre-commit. This merge preserves explicit opt-in switches and does not assert the unfinished 7-ms attention or 22-ms round targets. It adds no default activation or new service admission.